import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter)

const routes = [
  {
    path: "/",
    name: "x",
    meta: {
      title: ""
    },
    component: () => import("@/views/LoginView.vue"),
  },

  {
    path: "/Home",
    name: "Home",
    meta: {
      title: "首页",
    },
    component: () => import("@/views/home"),
    children: [
      {
        path: "/hello",
        name: "hello",
        meta: {
          title: "",
          id: 0,
        },
        component: () => import("@/views/hello.vue"),
      },
      {
        path: "/myInformation",
        name: "myInformation",
        meta: {
          title: "",
          id: 0,
        },
        component: () => import("@/views/myInformation.vue"),
      }, {
        path: '/noticedetails',
        name: 'noticedetails',
        meta: {
          title: "通知详情"
        },
        component: () => import('@/views/notice/noticedetails'),
      },


    ]
  },
  {
    path: '/login',
    name: 'login',
    meta: {
      title: "登录"
    },
    component: () => import('@/views/LoginView.vue'),
  },
  {
    path: '/myroles',
    name: 'myroles',
    meta: {
      title: "我的职位"
    },
    component: () => import('@/views/myroles.vue'),
  },
  {
    path: '/loadingz',
    name: 'loadingz',
    meta: {
      title: "中间站"
    },
    component: () => import('@/views/loadingz.vue'),
  },


]

const router = new VueRouter({
  mode: 'hash',
  base: process.env.BASE_URL,
  routes
})

export function resetRouter() {
  router.matcher = new VueRouter({ mode: 'history', base: 's-connect', routes: [] }).matcher;
}




export default router
